class GenreateClosedQuestions < ActiveRecord::Migration
  def self.up
  	
  	  	
  	closed_id=QuestionType.find_by_name("closed question").id
  	
  	i=0
  	for survey in Survey.find(:all)
  
	  	0.upto(rand(4)) do |x|
			Question.create(:surveyID=>survey.id,:typeID=>closed_id,:question=>"Jest ok?")
		end	
	  	
  	end
  	
  	
  end

  def self.down
  	Question.delete_all()
  end
end
